package com.itheima.Test01;

public class Demo04 {
    public static void main(String[] args) {
        //public String();  :创建一个空白字符串对象,不含有任何内容
        String s1 = new String();
        s1 = "10";
        System.out.println(s1);

        //public String(char[] chs); :根据字符数组的内容,来创建字符串对象
        char[] chs = {'a','b','c'};
        String s2 = new String(chs);
        System.out.println(s2);

        //public String(String original); :根据传入的字符串内容,来创建字符串对象
        String s3 = new String("123");
        System.out.println(s3);

        String s4 = "abc";
        String s5 = "ABC";
        String s6 = "abc";

        //equals :比较字符串内容,区分大小写
        System.out.println(s4.equals(s5));
        System.out.println(s4.equals(s6));

        ////equalsIgnoreCase :比较字符串内容,忽略大小写
        System.out.println(s4.equalsIgnoreCase(s5));



    }
}
